<!DOCTYPE HTML />
<html>
<head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>宝纳Club</title>
    <META HTTP-EQUIV="expires" CONTENT="0">
    <?php include_once("common/common_js.php") ?>
    <script type="text/javascript" src="/js/YlMarquee.js"></script>
    <?php
            if (array_key_exists("synCode", $view)) {
    echo $view['synCode'];
}
    ?>
    <style type="text/css">
        .part_a .r .active2 .c {
            display: inline-block;
            margin-right: 2px;
        }
    </style>
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
        }

        img {
            border: none;
        }

        #slide {
            overflow: hidden;
            width: 820px;
        }

        ul {
            list-style: none;
        }

        #slide li {
            float: left;
            display: block;
        }

        .slideul1 {
            width: 3999px;
        }
    </style>
</head>
<body>
<?php include_once("common/banner.php"); ?>
<div class="warpper">
<div class="a_1">
    <img src="/images/a1.png">
</div>
<?php include_once("common/header.php"); ?>
<div class="part_a">
    <div class="l">
        <div class="title">每日之星</div>
        <?php if ($view['dayStar']['applicationId'] > 0) { ?>
        <div style="margin-top:5px;">


            <a href='/index.php/stars/all/1'><img
                    src="<?php echo $view['dayStar']['photo'] ?>"
                    style="width:275px;height:218px;"/></a></div>
        <div class="infob">
            <div class="name"><?php echo $view['dayStar']['name'] ?>(<?php
                    $userVote = $this->modules->UserVote;
                echo $userVote->findCountByUserId($view['dayStar']['applicationId'], 1);
                ?>票) |<span style="cursor: pointer"
                            onclick="voteApplication(<?php echo $view['dayStar']['applicationId'] ?>)">投票</span>
            </div>
            <div class="info">
                <label><?php echo $view['dayStar']['motto'] ?></label>
                <span>年龄：<?php echo $view['dayStar']['age'] ?> 身高：<?php echo $view['dayStar']['height'] ?>
                    cm 体重:<?php echo $view['dayStar']['weight'] ?>kg</span>

            </div>
        </div>
                                                                     <?php

    }
    else
        echo "<img src='/img/none.jpg' style='width:275px;height: 328px;'/>";
        ?>
    </div>
    <div class="r">
        <div class="active">
            <div class="title"><a
                    href="<?php echo URL_PREFIX; ?>/activities/show/<?php echo $view['nearliestActivity']['activityId']; ?>"><?php echo $view['nearliestActivity']['title'] ?></a>
            </div>
            <div class="content">

                <div style="float:left;width: 300px;">
                    <p><?php echo substr($view['nearliestActivity']['description'],0,300) ?>
                    </p>

                    <p>
                        活动咨询热线：<?php echo $view['nearliestActivity']['tel'] ?>

                    </p>

                    <p>活动时间：<?php echo $view['nearliestActivity']['startDate'] ?>
                        -  <?php echo $view['nearliestActivity']['endDate'] ?></p>
                </div>
                <div style="float:right; padding-right: 10px; padding-top: 5px;">
                    <a href="<?php echo URL_PREFIX; ?>/activities/show/<?php echo $view['nearliestActivity']['activityId']; ?>"><img
                            height="190px" width="180px;"
                            src='<?php echo $view['nearliestActivity']['picture'] ?>'/></a>
                </div>
            </div>
        </div>
        <div class="active2">
            <div class="list">
                <?php foreach ($view['nearliestActivities'] as $value) { ?>
                <div class="c">
                    <div>
                        <a href='<?php echo URL_PREFIX; ?>/activities/show/<?php echo $value['activityId']; ?>'><img
                                src="<?php echo $value['picture']; ?>" width="179" height="98"/></a></div>
                    <div class="ac">
                        <label><?php echo $value['title']; ?></label>
                        <span value="<?php echo $value['activityId']; ?>"></span>
                    </div>
                </div>
                <?php }?>
            </div>
        </div>
    </div>
</div>
<div class="banner"><img src="/images/ad.png"></div>
<div class="part_b">
    <div class="l">

        <div class="list">
            <?php foreach ($view['dayStars'] as $value) { ?>
            <div class="p">
                <a href='/index.php/stars/all/1'><img width="102" height="132" src="<?php echo $value['photo'] ?>"/></a>
                <label><?php echo $value['name'] ?>(<?php
                    $userVote = $this->modules->UserVote;
                    echo $userVote->findCountByUserId($value['applicationId'], 1);
                    ?>票) |<a href='#'
                             onclick="voteApplication(<?php echo $value['applicationId']; ?>)">投票</a></label>
            </div>
            <?php }?>
        </div>
    </div>
    <div class="r">
        <div id="loginForm">
            <form action="/index.php/Passport/signin" method="post" name="loginForm">
                <input type="hidden" name="type" value="user"/>

                <div style="padding-left:10px;padding-top:20px;">
                    <div class="t"> / 用户 /</div>
                    <div><input name="userName" type="text" class="txt"/></div>

                    <div class="t"> / 密码 /</div>
                    <div><input name="password" type="password" class="txt"/></div>

                    <div style="padding-top: 10px;"><input type="submit" value="登录">&nbsp;&nbsp;<input type="button"
                                                                                                       onclick="javascript:window.location.href='/index.php/Passport/signup'"
                                                                                                       value="注册">
                    </div>

                    <div style="color:#929090;padding-top:10px;">忘记密码了吗？<a href="/index.php/Passport/password"
                                                                           style="color:white;">点击这里</a>，
                        找回密码。
                    </div>


                </div>
            </form>
        </div>

        <div style="padding-top:50px;padding-left:10px;">
            <div style="color:#81ba27;"> 会员好处</div>
        </div>
    </div>
</div>
<div class="banner"><img src="/images/ad.png"></div>
<div class="part_c">
    <div class="l">
        <a href='/index.php/newstype/show/1'><img src="/images/temp8_1.png"></a>
        <a href='/index.php/newstype/show/2'> <img src="/images/temp8_2.png"></a>
        <a href='/index.php/newstype/show/3'><img src="/images/temp8_3.png"></a>
        <a href='/index.php/newstype/show/4'><img src="/images/temp8_34.png"></a>
    </div>
    <div class="r">
        <div class="title">论坛精选</div>
        <div>
            <ul>
                <?php foreach ($view['bbs'] as $value) { ?>
                <li>
                    <a href='/bbs/viewthread.php?tid=<?php echo $value['tid'] ?>'
                       target="_blank"><?php echo $value['subject'] ?></a>
                </li>
                <?php } ?>
            </ul>
        </div>
    </div>
</div>
<div class="part_d">
    <div class="header">
        <div class="title">海选佳丽</div>

        <form action="<?php echo URL_PREFIX; ?>/stars/xuanshous" method="post">
            <div class="search">
                <input type="text" name="keyWord" class="txt"><input type="submit" class="btn" value="搜索"/><a
                    style="margin-left: 10px; color: white" href="/index.php/stars/xuanshous">更多</a>
            </div>

        </form>


    </div>
    <div class="stroll">
        <ul class="ylMarquee">
    <?php
                                                                                             $count = 0;
        foreach ($view['lastApplication'] as $value) {
            if ($count <= 6) {
                $count++;

                ?>
                <li style="margin-left: 10px;">
                    <a href='/index.php/stars/all/1'>
                        <img width="102" height="132"
                             src="<?php echo $value['photo'];?>"/></a>

                    <p><?php echo $value['name'];?>(<?php
                    $userVote = $this->modules->UserVote;
                        echo $userVote->findCountByUserId($value['applicationId'], 1);
                        ?>票) |<a
                                href='javascript:void(0)'
                                onclick="voteApplication(<?php echo $value['applicationId']; ?>)">投票</a>
                    </p>
                </li>
                                                    <?php

            }
        }?>

        </ul>
    </div>
    <?php if (count($view['lastApplication']) > 7) { ?>
    <div class="stroll2">
        <ul class="ylMarquee">
            <?php
                                    $count = 0;
            foreach ($view['lastApplication'] as $value) {
                if ($count > 8) {
                    $count++;?>
                    <li style="margin-left: 10px;">
                        <a href='/index.php/stars/all/1'> <img width="102" height="132"
                                                               src="<?php echo $value['photo'];?>"/></a>

                        <p><?php echo $value['name'];?>(<?php
                    $userVote = $this->modules->UserVote;
                            echo $userVote->findCountByUserId($value['applicationId'], 1);
                            ?>票) |<a href='javascript:void(0)'
                                     onclick="voteApplication(<?php echo $value['applicationId']; ?>)">投票</a>
                        </p>
                    </li>
                                                        <?php

                }
            } ?>

        </ul>
    </div>
    <?php } ?>
</div>
<?php include("common/footer.php"); ?>
</div>
<script language="javascript">
    $(function() {
        $(".ac span").bind("click", function() {
            $.get("<?php echo URL_PREFIX; ?>/ajax/voteActivity", {"activityId":$(this).attr("value")}, function(data) {
                alert(data);
                return false;
            })
        })
    })
    function voteApplication(applicationId) {
        $.get("<?php echo URL_PREFIX; ?>/ajax/voteApplication", {operatorId:1,operatedId:applicationId}, function(data) {
            alert(data);
        })
    }

    $(document).ready(function() {
        $(".stroll").jMarquee({
            visible:7,
            step:1,
            direction:"left"
        });
        $(".stroll2").jMarquee({
            visible:7,
            step:1,
            direction:"left"
        });
    });
</script>
<script type="text/javascript">

</script>
</body>
</html>